package com.ywy.bootadmin.elfinder.core.impl.aliyunoss;

import com.aliyun.oss.model.OSSObjectSummary;
import com.ywy.bootadmin.elfinder.core.Target;
import com.ywy.bootadmin.elfinder.core.Volume;

public class AliyunOssFileSystemTarget implements Target {
    private final Volume volume;

    private OSSObjectSummary ossObject;

    public AliyunOssFileSystemTarget(AliyunOssFileSystemVolume volume, OSSObjectSummary ossObject) {
        this.volume = volume;
        this.ossObject = ossObject;
    }

    @Override
    public Volume getVolume() {
        return volume;
    }

    public String getKey() {
        return this.ossObject.getKey();
    }

    public long getLastModified(){
        return ossObject.getLastModified().getTime();
    }

    public long getSize(){
        return ossObject.getSize();
    }

    public void setOssObject(OSSObjectSummary ossObject) {
        this.ossObject = ossObject;
    }
}
